<?php
//include("curltest.php");
include("myzhuaqu.php");
include("clcss.php");
$url = "http://nn.ilaoyou.com/index.php?XDEBUG_SESSION_START=20170322114231&app=seller_order";
$cookie = "7d64_sname=nn; CNZZDATA3845711=cnzz_eid%3D1105023350-1482802100-%26ntime%3D1490164944; UM_distinctid=15ad10c9b60a-091e52e1a6e366-44504130-1aeaa0-15ad10c9b612f1; ECM_ID=d0ec667413591568a443c3b32baa376c5a722d5b; SSCSum=13; userkey=; XDEBUG_SESSION=20170322154101";
$referer = "http://nn.ilaoyou.com/index.php?XDEBUG_SESSION_START=20170322114223&app=my_goods";
$q = new myzhuaqu();
$nr = $q->curl($url, "", $cookie, $referer);
preg_match_all("/<link[^<>]*href=\"([^<>]*\.css)\"/Uisx", $nr, $nn);
$allclass = "";
for ($i = 0; $i < count($nn[1]); $i++) {
    $cssurl = $nn[1][$i];
    $nr = $q->curl($cssurl);
    $nr = clcss($nr, $cssurl);
    $allclass .= $nr;
}
preg_match_all("/^(.*)$/m",$allclass,$nn);
$cssarr=array();
for ($i = count($nn[1]); $i >=0; $i--) {
    if(trim($nn[1][$i])==""){
        continue;
    }
    preg_match("/^(.*)\{(.*)\}/Uisx",$nn[1][$i],$nn2);
    $xpath=xpath($nn2[1]);
    $oo=explode(",",$xpath);
    for($j=0;$j<count($oo);$j++) {
        $name=trim($oo[$j]);
        $style = trim($nn2[2]);
        $cssarr[] ="{\"xp\":\"{$name}\",\"style\":\"{$style}\"}";
    }
}

?>